package com.karaoke.android.home.binding

import android.databinding.BindingAdapter
import android.graphics.drawable.Drawable
import com.karaoke.android.home.widget.PopupButton

/**
 * Created by Allen on 2016/10/22.
 */
object PopupButtonBindingAdapter
{
    @BindingAdapter("text")
    @JvmStatic
    fun setText(button: PopupButton, text: String)
    {
        button.title = text
    }

    @BindingAdapter("iconBackground")
    @JvmStatic
    fun setIconBackground(button: PopupButton, drawable: Drawable)
    {
        button.iconBtn.background = drawable
    }

    @BindingAdapter("icon")
    @JvmStatic
    fun setIcon(button: PopupButton, resId: Int)
    {
        button.icon = resId
    }
}